public class Student implements Comparable {
    private Integer id;
    private String name;

    public Student(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    @Override
    public int compareTo(Object o) {
        if (o != null && o instanceof Student) {
            Student student = (Student) o;
            return this.name.compareTo(student.name);
        }
        return -1;
    }

    @Override
    public String toString() {
        return (getId()) + " " + getName();
    }

    public Integer getId() {
        return this.id;
    }

    public String getName() {
        return this.name;
    }
}
